import tkinter
from tkinter import *
from plane_main import *


def project():
    if __name__ == "__main__":
        game = PlaneGame()
        game.star_game()


def windows2():
    window2 = tkinter.Tk()
    window2.title("小组成员")
    window2.geometry("1300x150")
    width = 1250
    cas = Canvas(window2, bg="white", width=1300, height=50)
    cas.pack()
    x = 0
    cas.create_text(x, 30,
                    text="小组成员:卓恒17060315120，陈超18060314102"
                         "，柴士雄18060314101，梁栋梁18060314110，焦庆玉18060314109。"
                    , font=('', '36', ''), tags="text")
    dx = 5
    while True:
        cas.move("text", dx, 0)
        cas.after(100)
        cas.update()
        if x < width:
            x += dx
        else:
            x = 0
            cas.delete("text")
            cas.create_text(x, 30, text="小组成员:卓恒17060315120，陈超18060314102"
                                        "，柴士雄18060314101，梁栋梁18060314110，焦庆玉18060314109。)"
                            , font=('', '36', ''), tags="text")


def exit():
    sys.exit()


window = tkinter.Tk()

canvas = tkinter.Canvas(window, width=900, height=600, bd=0).pack()
window.resizable(False, False)
window.title("Python编程作业")
filename = PhotoImage(file="./图片/background1.png")
background_label = Label(window, image=filename)
background_label.place(x=0, y=0, anchor=NW)

result = StringVar()
entry = Entry(window, background="white", justify="center", textvariable=result, font=('', '40', ''))
entry.place(x=200, y=100, width=500, height=90)
result.set("18060314信抗作业")

bt1 = Button(window, text="退出", width="8", height="1", font=('', '26', ''), command=exit).place(x=600, y=330)
bt2 = Button(window, text="关于", width="8", height="1", font=('', '26', ''), command=windows2).place(x=380, y=330)
bt3 = Button(window, text="运行", width="8", height="1", font=('', '26', ''), command=project).place(x=160, y=330)

window.mainloop()


